remove some unused code. (#976)
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Sun, 8 Jan 2023 15:52:06 +0000 (08:52 -0700)
committerGitHub <noreply@github.com>
Sun, 8 Jan 2023 15:52:06 +0000 (08:52 -0700)
gbser.cc
gbser.h
gbser_private.h
gbser_win.cc

index bda793e52b3efc4dbbe5c693d188c0a3b5ce76ce..0f9e98423a86d6b4d755529bfe607c843395cf85 100644 (file)
--- a/gbser.cc
+++ b/gbser.cc
@@ -44,67 +44,6 @@ int gbser_set_speed(void* handle, unsigned speed)
   return gbser_set_port(handle, speed, 8, 0, 1);
 }
 
-static int parity_letter(char c)
-{
-  switch (c) {
-  case 'N':
-  case 'n':
-    return 0;
-  case 'O':
-  case 'o':
-    return 1;
-  case 'E':
-  case 'e':
-    return 2;
-  default:
-    return -1;
-  }
-}
-
-/* Set the serial port up by parsing the supplied parameter string.
- * Valid parameter strings look like '4800,8,N,1'. Parsing is case-
- * insensitive, spaces are allowed around the commas and omitted
- * trailing fields will default to '8', 'N' and '1'
- */
-int gbser_setup(void* handle, const char* spec)
-{
-  unsigned arg[] = { 4800, 8, 0, 1 };
-
-  for (unsigned int ap = 0; ap < sizeof(arg) / sizeof(arg[0]); ap++) {
-    unsigned t = 0;
-    int pl;
-    while (isspace(*spec)) {
-      spec++;
-    }
-    /* Allow 'N', 'O' or 'E' as the parity spec */
-    if (ap == 2 && (pl = parity_letter(*spec), pl >= 0)) {
-      t = pl;
-      spec++;
-    } else {
-      if (!isdigit(*spec)) {
-        break;
-      }
-      while (isdigit(*spec)) {
-        t = t * 10 + *spec++ - '0';
-      }
-    }
-    arg[ap] = t;
-    while (isspace(*spec)) {
-      spec++;
-    }
-    if (*spec != ',') {
-      break;
-    }
-    spec++;
-  }
-
-  if (*spec != '\0') {
-    return gbser_ERROR;
-  }
-
-  return gbser_set_port(handle, arg[0], arg[1], arg[2], arg[3]);
-}
-
 /* Return true if there are characters available on the serial port
  */
 int gbser_avail(void* handle)
diff --git a/gbser.h b/gbser.h
index d6b332a5d176080650dc36fefdf7b007720627db..8c73480ed7edbf62a930e9dcf846f612d1288f7a 100644 (file)
--- a/gbser.h
+++ b/gbser.h
@@ -56,13 +56,6 @@ int gbser_set_port(void* handle, unsigned speed,
                    unsigned parity,
                    unsigned stop);
 
-/* Set the serial port up by parsing the supplied parameter string.
- * Valid parameter strings look like '4800,8,N,1'. Parsing is case-
- * insensitive, spaces are allowed around the commas and omitted
- * trailing fields will default to '8', 'N' and '1'
- */
-int gbser_setup(void* handle, const char* spec);
-
 /* Return true if there are characters available on the serial port
  */
 int gbser_avail(void* handle);
index 568d6314b6bc270c93c34f36931ac4aa8f199237..e69de4db2526b500cbe3463f63255068b26a3fe3 100644 (file)
@@ -25,6 +25,6 @@
 #define BUFSIZE 512
 
 void gbser_db(int l, const char* msg, ...);
-int gbser_fill_buffer(void* h, unsigned want, unsigned* ms);
+int gbser_fill_buffer(void* handle, unsigned want, unsigned* ms);
 unsigned gbser_read_buffer(void* handle, void** buf, unsigned* len);
 #endif // GBSER_PRIVATE_H_
index 3a19406a243d458371e7e145966d7af3076b1469..0fd08e71974530f56b2b486d6e0d6094ac98c64f 100644 (file)
@@ -141,7 +141,7 @@ static int set_rx_timeout(gbser_handle* h, DWORD timeout)
  *
  * Worse still, Win98 and ME fail the open if you rename com1 to be \\.\\com1:
  *
- * It returns a pointer to a staticly allocated buffer and is therefore not
+ * It returns a pointer to a statically allocated buffer and is therefore not
  * thread safe.   The buffer pointed to remains valid only until the next
  * call to this function.
  */